package baidu;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int testCase;
		int number;
		int[] numbersAll;
		int[] numbersDaka;
		int result;
		testCase = scanner.nextInt();
		for(int j = 0; j < testCase; j++){
			number = scanner.nextInt();
			result = 0;
			numbersAll = new int[number];
			numbersDaka = new int[number - 1];
			for (int i = 0; i < number; i++) {
				numbersAll[i] = scanner.nextInt();
			}
			for (int i = 0; i < number - 1; i++) {
				numbersDaka[i] = scanner.nextInt();
			}
			for (int i = 0; i < number; i++) {
				result ^= numbersAll[i];
			}
			for (int i = 0; i < number - 1; i++) {
				result ^= numbersDaka[i];
			}
			System.out.println(result);
		}
		scanner.close();
	}
}
